package com.amx.controller;

import com.alibaba.fastjson.JSON;
import com.amx.Pojo.MainMenu;
import com.amx.dao.MenuDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 一只安慕嘻
 * @create 2021-08-04 10:34
 */

@RestController
public class MenuController {

    @Autowired
    MenuDao menuDao;

    @RequestMapping("/menus")
    public String getAllMenus(){
        List<MainMenu> menus = menuDao.getMenus();
        System.out.println(menus);
        return JSON.toJSONString(menus);
    }
}
